package cn.sylinx.horm.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * log toolkit
 * 
 * @author han
 *
 */
public abstract class GLog {

    private GLog() {
    }

    /**
     * the logger
     */
    private static final Logger logger = LoggerFactory.getLogger(GLog.class);

    /**
     * info
     * 
     * @param message message
     * @param params  params
     */
    public static void info(String message, Object... params) {
        if (logger.isInfoEnabled()) {
            logger.info(message, params);
        }
    }

    /**
     * debug
     * 
     * @param message the message
     * @param params  the params
     */
    public static void debug(String message, Object... params) {
        if (logger.isDebugEnabled()) {
            logger.debug(message, params);
        }
    }

    /**
     * error
     * 
     * @param message the message
     * @param t       the Throwable
     */
    public static void error(String message, Throwable t) {
        if (logger.isErrorEnabled()) {
            logger.error(message, t);
        }
    }

    public static void error(String message, Object... params) {
        if (logger.isErrorEnabled()) {
            logger.error(message, params);
        }
    }

    public static void warn(String message, Object... params) {
        if (logger.isWarnEnabled()) {
            logger.warn(message, params);
        }
    }
}
